import 'package:netstorage/model/hotel.dart';

class GridNav {
  Hotel? hotel;
  Hotel? flight;
  Hotel? travel;

  GridNav({this.hotel,this.flight,this.travel});
  factory GridNav.fromJson(Map<String,dynamic> map){
    Map<String,dynamic> hotelMap = map['hotel'] ?? {};
    Hotel? hotel = Hotel.fromJson(hotelMap);

    Map<String,dynamic> flightMap = map['flight'] ?? {};
    Hotel? flight = Hotel.fromJson(flightMap);

    Map<String,dynamic> travelMap = map['travel'] ?? {};
    Hotel? travel = Hotel.fromJson(travelMap);

    return GridNav(hotel: hotel, flight: flight, travel:travel);
  }

  Map<String,dynamic> toJson(){
    Map<String,dynamic> ret = {};
    ret['hotel'] = hotel;
    ret['flight'] = flight;
    ret['travel'] = travel;
    return ret;
  }

  @override
  String toString() {
    return 'hotel:${hotel.toString()}, flight:${flight.toString()}, travel:${travel.toString()}';
  }
}